﻿namespace TC
{
    public class FloatConvert : VariableNode
    {
        public ValueInput<float> valueIn;
        public ValueOutput<int> intOut;
        public ValueOutput<double> doubleOut;
        public ValueOutput<string> stringOut;
        public ValueOutput<bool> boolOut;

        public override void OnCreate()
        {
            base.OnCreate();

            valueIn = this.AddValueInPort<float>("valueIn");
            intOut = this.AddValueOutPort<int>("intOut", () => { return (int)valueIn.Value; });
            doubleOut = this.AddValueOutPort<double>("doubleOut", () => { return valueIn.Value; });
            stringOut = this.AddValueOutPort<string>("stringOut", () => { return valueIn.Value.ToString(); });
            boolOut = this.AddValueOutPort<bool>("boolOut", () => { return valueIn.Value == 0 ? false : true; });
        }
    }
}
